<template>
  <div>
    <el-header>
      <div style="display: flex; justify-content: space-between; align-items: center; width: 100%;">
        <span style="position: absolute; left: 50%; transform: translateX(-50%);">{{main.qualityManagement}}</span>

        <!-- 右侧区域 -->
        <div style="display: flex; align-items: center; margin-left: auto; gap: 15px;">
          <!-- 语言选择 -->
          <el-dropdown style="font-size: 16px; cursor: pointer; color: #fff;">
        <span class="el-dropdown-link" style="color: white; cursor: pointer; display: flex; align-items: center;">
          {{ selectedLanguage }}<i class="el-icon-arrow-down el-icon--right"></i>
        </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item @click.native="languageSelect('chinese')">中文</el-dropdown-item>
              <el-dropdown-item @click.native="languageSelect('english')">English</el-dropdown-item>
              <el-dropdown-item @click.native="languageSelect('russian')">Русский язык</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>

          <!-- 用户信息 -->
          <el-popover
              placement="bottom-end"
              title="用户信息"
              width="200"
              trigger="hover"
              :visible-arrow="true">
            <div style="margin-top: 10px">Name：{{useName}}</div>
            <div style="margin-top: 10px">ID:{{useId}}</div>
            <div style="margin-top: 10px; cursor: pointer;" @click="logOut">
              <el-link type="primary">{{main.logOut}}</el-link>
            </div>
            <div class="headMain" slot="reference" >
              <i class="el-icon-user"></i>{{useName}}
            </div>
          </el-popover>
        </div>
      </div>
    </el-header>
    <!--整体外框架-->
    <div class="mainDiv">
      <!--体系管理框架-->
      <div>
        <div style="margin-top: 10px">
          <span class="mainTitle" >{{main.systemManagement}}</span>
          <hr>
        </div>
        <!--包住下面的每一个小板块（体系管理框架）-->
        <div class="card-container">
          <!--体系管理系统-->
          <el-card  class="cadMain" shadow="hover" >
            <span class="textBottom" >
              <el-link @click="control(18)"
                       style="color: black; font-size: medium"
                       :disabled="Number(cardDisabled.toExamineProblem)===0 || cardDisabled.toExamineProblem===undefined || cardDisabled.toExamineProblem===null || cardDisabled.toExamineProblem===''" >{{main.systemManagement}}</el-link></span>
          </el-card>
          <!--问题管理-->
          <el-card  class="cadMain" shadow="hover" >
            <span class="textBottom" >
              <el-link @click="control(1)"
                       style="color: black; font-size: medium"
                       :disabled="Number(cardDisabled.problemManagement)===0 || cardDisabled.problemManagement===undefined || cardDisabled.problemManagement===null || cardDisabled.problemManagement===''">{{main.questionManagement}}</el-link></span>
          </el-card>
          <!--可疑品业务-->
          <el-card  class="cadMain" shadow="hover" >
            <span class="textBottom" >
            <el-link @click="control(24)"
                     style="color: black; font-size: medium"
                     :disabled="cardDisabled[24]">{{main.suspiciousProduct}}</el-link></span>
          </el-card>
          <!--报警解除业务-->
          <el-card  class="cadMain" shadow="hover" >
            <span class="textBottom" >
            <el-link @click="control(21)"
                     style="color: black; font-size: medium"
                     :disabled="cardDisabled[21]">{{main.alarmRelease}}</el-link></span>
          </el-card>
          <!--良品条件业务-->
          <el-card  class="cadMain" shadow="hover" >
            <span class="textBottom" >
            <el-link @click="control(9)"
                     style="color: black; font-size: medium"
                     :disabled="Number(cardDisabled.goodProductCondition)===0 || cardDisabled.goodProductCondition===undefined || cardDisabled.goodProductCondition===null || cardDisabled.goodProductCondition===''">{{main.goodProductConditions}}</el-link></span>
          </el-card>
        </div>
      </div>
      <hr>
      <!--标准作业管理系统框架-->
      <div>
        <div style="margin-top: 10px">
          <span class="mainTitle" >{{main.standardWorkManagement}}</span>
          <hr>
          <div class="card-container">
            <!--工序指导书管理-->
            <el-card  class="cadMain" shadow="hover" >
              <span class="textBottom" >
              <el-link @click="control(4)"
                       style="color: black; font-size: medium"
                       :disabled="Number(cardDisabled.operateGuideBook)===0 || cardDisabled.operateGuideBook===undefined || cardDisabled.operateGuideBook===null || cardDisabled.operateGuideBook===''">{{main.operationInstruction}}</el-link></span>
            </el-card>
            <!--零部件指导书管理-->
            <el-card  class="cadMain" shadow="hover" >
              <span class="textBottom" >
              <el-link @click="control(5)" style="font-size: medium" disabled>{{main.partsInstruction}}</el-link></span>
            </el-card>
            <!--低频作业指导书-->
            <el-card  class="cadMain" shadow="hover">
              <span class="textBottom" >
              <el-link @click="control(11)"
                       style="color: black; font-size: medium"
                       :disabled="Number(cardDisabled.changeModel)===0 || cardDisabled.changeModel===undefined || cardDisabled.changeModel===null || cardDisabled.changeModel===''">{{main.lowFrequencyWorkInstruction}}</el-link></span>
            </el-card>
            <!--标准作业引导系统-->
            <el-card  class="cadMain" shadow="hover">
              <span class="textBottom" >
              <el-link @click="control(17)"
                       style="color: black; font-size: medium"
                       :disabled="cardDisabled[17]">{{main.standardWorkGuidance}}</el-link></span>
            </el-card>
          </div>
        </div>
      </div>
      <hr>
      <!--过程能力管理框架-->
      <div>
        <div style="margin-top: 10px">
          <span class="mainTitle" >{{main.processCapabilityManagement}}</span>
          <hr>
        </div>
        <!--包住下面的每一个小板块（过程能力管理系统）-->
        <!--防错管理-->
        <el-card  class="cadMain" shadow="hover" >
          <span class="textBottom" >
          <el-link @click="control(3)" style="font-size: medium" disabled>{{main.errorProofingManagement}}</el-link></span>
        </el-card>
        <!--工装管理-->
        <el-card  class="cadMain" shadow="hover" >
          <span class="textBottom" >
          <el-link @click="control(14)" style="font-size: medium" disabled>{{main.fixtureManagement}}</el-link></span>
        </el-card>
      </div>
      <hr>
      <!--外购件管理框架-->
      <div>
        <div style="margin-top: 10px">
          <span class="mainTitle" >{{main.purchasedParts}}</span>
          <hr>
          <!--入厂检验管理-->
          <el-card  class="cadMain" shadow="hover" >
            <span class="textBottom" >
            <el-link @click="control(13)" style="font-size: medium" disabled>{{main.incomingInspection}}</el-link></span>
          </el-card>
          <!--叫料系统-->
          <el-card  class="cadMain" shadow="hover" >
            <span class="textBottom" >
            <el-link @click="control(22)" style="font-size: medium" disabled>{{main.materialCallOut}}</el-link></span>
          </el-card>
        </div>
      </div>
      <hr>
      <!--可靠高效的工艺-->
      <div>
        <div style="margin-top: 10px">
          <span class="mainTitle" >{{main.processManagement}}</span>
          <hr>
        </div>
        <!--包住下面的每一个小板块（可靠高效的工艺管理系统）-->
        <div class="card-container">
          <!--控制计划管理新-->
          <el-card  class="cadMain" shadow="hover" >
            <span class="textBottom" >
            <el-link @click="control(23)"
                     style="color: black; font-size: medium"
                     :disabled="Number(cardDisabled.controlPlanNew)===0 || cardDisabled.controlPlanNew===undefined || cardDisabled.controlPlanNew===null || cardDisabled.controlPlanNew===''">{{main.controlPlan}}</el-link></span>
          </el-card>
          <!--工序防错分析-->
          <el-card  class="cadMain" shadow="hover" >
            <span class="textBottom" >
            <el-link @click="control(17)" style="font-size: medium" disabled>{{main.operationErrorProofing}}</el-link></span>
          </el-card>
          <!--清洁度管理-->
          <el-card  class="cadMain" shadow="hover" >
            <span class="textBottom" >
            <el-link @click="control(7)" style="font-size: medium" disabled>{{main.cleanliness}}</el-link></span>
          </el-card>
        </div>
      </div>
      <hr>
      <div>
        <div style="margin-top: 10px">
          <span class="mainTitle"><strong>{{main.detectionCapability}}</strong></span>
          <hr>
        </div>
        <!--包住下面的每一个小板块（可靠高效的工艺系统）-->
        <div class="card-container">
          <!--频次检测/趋势预判-装配检验-->
          <el-card  class="cadMain" shadow="hover" >
            <span class="textBottom" >
            <el-link @click="control(26)"
                     style="color: black; font-size: medium"
                     :disabled="Number(cardDisabled.controlTesting)===0 || cardDisabled.controlTesting===undefined || cardDisabled.controlTesting===null || cardDisabled.controlTesting===''">{{main.assemblyInspection}}</el-link></span>
          </el-card>
          <!--频次检测/趋势预判-装配拧紧轴-->
          <el-card  class="cadMain" shadow="hover" >
            <span class="textBottom" >
            <el-link @click="control(12)"
                     style="color: black; font-size: medium"
                     :disabled="cardDisabled[12]">{{main.assemblyTighteningShaft}}</el-link></span>
          </el-card>
          <!--频次检测/趋势预判-机加检验-->
          <el-card  class="cadMain" shadow="hover" >
            <span class="textBottom" >
            <el-link @click="control(19)"
                     style="color: black; font-size: medium"
                     :disabled="Number(cardDisabled.macTestCon)===0 || cardDisabled.macTestCon===undefined || cardDisabled.macTestCon===null || cardDisabled.macTestCon===''">{{main.machiningInspection}}</el-link></span>
          </el-card>
          <!--成品AI品质门-->
          <el-card  class="cadMain" shadow="hover" >
            <span class="textBottom" >
            <el-link @click="control(25)"
                     style="color: black; font-size: medium"
                     :disabled="cardDisabled[25]">{{main.qualityGate}}</el-link></span>
          </el-card>
          <!--发动机数据查询-->
          <el-card  class="cadMain" shadow="hover" >
            <span class="textBottom" >
            <el-link @click="control(27)"
                     style="color: black; font-size: medium"
                     :disabled="cardDisabled[27]">{{main.engineDataQuery}}</el-link></span>
          </el-card>
        </div>
      </div>
      <hr>
      <!--第六个管理项目（严谨的产品、过程设计）-->
      <div>
        <div style="margin-top: 10px">
          <span class="mainTitle"><strong>{{main.processDesign}}</strong></span>
          <hr>
        </div>
        <!--包住下面的每一个小板块（严谨的产品、过程设计）-->
        <div class="card-container">
          <!--装配设备维护-->
          <el-card  class="cadMain" shadow="hover" >
            <span class="textBottom" >
            <el-link @click="control(2)" style="font-size: medium" disabled>{{main.equipmentMaintenance}}</el-link></span>
          </el-card>
          <!--装配设备管理-->
          <el-card  class="cadMain" shadow="hover" >
            <span class="textBottom" >
            <el-link @click="control(15)" style="font-size: medium" disabled>{{main.equipmentManagement}}</el-link></span>
          </el-card>
        </div>
      </div>

      <hr>
      <!--第七个管理项目（严谨的产品、过程设计）-->
      <div>
        <div style="margin-top: 10px">
          <span class="mainTitle"><strong>{{main.basicInformation}}</strong></span>
          <hr>
        </div>
        <!--包住下面的每一个小板块（严谨的产品、过程设计）-->
        <div class="card-container">
          <!--岗位职管理-->
          <el-card  class="cadMain" shadow="hover" >
            <span class="textBottom" >
            <el-link @click="control(10)"
                     style="color: black; font-size: medium"
                     :disabled="cardDisabled[10]">{{main.jobResponsibility}}</el-link></span>
          </el-card>
          <!--基本信息维护-->
          <el-card  class="cadMain" shadow="hover" >
            <span class="textBottom" >
            <el-link @click="control(6)"
                     style="color: black; font-size: medium"
                     :disabled="cardDisabled[6]">{{main.basicInformationMaintenance}}</el-link></span>
          </el-card>
          <!--成熟度提升-->
          <el-card  class="cadMain" shadow="hover" >
            <span class="textBottom" >
            <el-link @click="control(20)" style="font-size: medium" disabled>{{main.maturityImprovement}}</el-link></span>
          </el-card>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  props: {
    msg: String
  },
  data(){
    return{
      useName:'',//用户名称
      useId:'',//用户编号
      selectedLanguage:'中文',
      languageS:'chinese',
      main:{
        logOut:'退出',
        qualityManagement:'俄罗斯动力质量管理平台',
        systemManagementSystem:'体系管理系统',
        systemManagement:'体系管理系统',
        questionManagement:'问题管理',
        suspiciousProduct:'可疑品业务',
        alarmRelease:'报警解除业务',
        goodProductConditions:'良品条件业务',
        standardWorkManagement:'标准作业管理系统',
        operationInstruction:'工序指导书管理',
        partsInstruction:'零部件指导书管理',
        lowFrequencyWorkInstruction:'低频作业指导书',
        standardWorkGuidance:'标准作业引导系统',
        processCapabilityManagement:'过程能力管理系统',
        errorProofingManagement:'防错管理',
        fixtureManagement:'工装管理',
        purchasedParts:'外购件管理系统',
        incomingInspection:'入厂检验管理',
        materialCallOut:'叫料系统',
        processManagement:'可靠高效的工艺管理系统',
        controlPlan:'控制计划管理',
        controlPlanNew:'控制计划管理(新)',
        operationErrorProofing:'工序防错分析',
        cleanliness:'清洁度管理',
        detectionCapability:'可靠、准确的探测能力管理系统',
        assemblyInspection:'频次检测/趋势预判-装配检验',
        assemblyTighteningShaft:'频次检测/趋势预判-装配拧紧轴',
        machiningInspection:'频次检测/趋势预判-机加检验',
        qualityGate:'成品AI品质门',
        processDesign:'严谨的产品、过程设计',
        equipmentMaintenance:'装配设备维保',
        equipmentManagement:'装配设备管理',
        basicInformation:'基础信息维护',
        jobResponsibility:'岗位职责管理',
        basicInformationMaintenance:'基本信息维护',
        maturityImprovement:'成熟度提升',
        engineDataQuery:'发动机数据查询'
      },
      // 卡片禁用状态对象
      cardDisabled: {
        id: null, // 主键 - int auto_increment
        problemManagement: null, // 质量问题管理页权限 - int
        pokayoke: null, // 防错管理 - int
        userName: '', // 用户名(集团工号) - varchar(10)
        name: '', // 用户姓名 - varchar(30)
        equipmentMaintain: null, // 设备管理权限 - int
        base: null, // 基本表单编辑范围 - int
        componentGuideBook: null, // 零部件作业指导书权限 - int
        controlTesting: null, // 频次检测页权限 - int
        changeModel: null, // 低频作业指导书权限 - int
        operateGuideBook: null, // 工序作业指导书权限 - int
        controlPlan: null, // 控制计划权限 - int
        systemDocument: null, // 体系文件页面权限 - int
        equipmentManagement: null, // 工装管理页权限 - int
        macTestCon: null, // 过程能力监视系统权限 - int
        goodProductCondition: null, // 良品条件人员权限 - int
        suspectProduct: null, // 可疑品业务权限 - int
        controlPlanNew: null, // 控制计划(新) - int
        toExamineProblem: null // 体系管理系统人员权限 - int
      },
    }
  },
  methods:{
    //查询用户信息的函数
    inquiry(){
      //输入用户编号，向后端查询信息
      const useId=localStorage.getItem('userName').replace(/"/g, '');
      this.$request.post('/useQueryPower',{
        queryFiledName:'problemManagement',
        userId:useId,
      }).then(result=>{
        if (result.code === 401) {
          this.$router.push('UserLogin')
          alert("您未登录，请登录")
        }else {
          this.useName=result.data.name
          this.usePower=result.data.problemManagement
          this.useId=useId
        }
      })
    },
    //退出登录
    logOut(){
      localStorage.removeItem('u_token');
      localStorage.removeItem('userName')
      this.$router.push('UserLogin')
    },
    languageSelect(language){
      this.selectedLanguage=language
      this.languageS=language
      if (language==='chinese'){
        this.main.logOut='退出'
        this.main.qualityManagement='俄罗斯动力质量管理平台'
        this.main.systemManagementSystem='体系管理系统'
        this.main.systemManagement='体系管理系统'
        this.main.questionManagement='问题管理'
        this.main.suspiciousProduct='可疑品业务'
        this.main.alarmRelease='报警解除业务'
        this.main.goodProductConditions='良品条件业务'
        this.main.standardWorkManagement='标准作业管理系统'
        this.main.operationInstruction='工序指导书管理'
        this.main.partsInstruction='零部件指导书管理'
        this.main.lowFrequencyWorkInstruction='低频作业指导书'
        this.main.standardWorkGuidance='标准作业引导系统'
        this.main.processCapabilityManagement='过程能力管理系统'
        this.main.errorProofingManagement='防错管理'
        this.main.fixtureManagement='工装管理'
        this.main.purchasedParts='外购件管理系统'
        this.main.incomingInspection='入厂检验管理'
        this.main.materialCallOut='叫料系统'
        this.main.processManagement='可靠高效的工艺管理系统'
        this.main.controlPlan='控制计划管理'
        this.main.controlPlanNew='控制计划管理(新)'
        this.main.operationErrorProofing='工序防错分析'
        this.main.cleanliness='清洁度管理'
        this.main.detectionCapability='可靠、准确的探测能力管理系统'
        this.main.assemblyInspection='频次检测/趋势预判-装配检验'
        this.main.assemblyTighteningShaft='频次检测/趋势预判-装配拧紧轴'
        this.main.machiningInspection='频次检测/趋势预判-机加检验'
        this.main.qualityGate='成品AI品质门'
        this.main.processDesign='严谨的产品、过程设计'
        this.main.equipmentMaintenance='装配设备维保'
        this.main.equipmentManagement='装配设备管理'
        this.main.basicInformation='基础信息维护'
        this.main.jobResponsibility='岗位职责管理'
        this.main.basicInformationMaintenance='基本信息维护'
        this.main.maturityImprovement='成熟度提升'
        this.main.engineDataQuery='发动机数据查询'
      }
      else if (language==='english'){
        this.main.logOut='Log out'
        this.main.qualityManagement='Quality Management Platform'
        this.main.systemManagementSystem='System Management System'
        this.main.systemManagement='System Management'
        this.main.questionManagement='Question Management'
        this.main.suspiciousProduct='Suspicious Product'
        this.main.alarmRelease='Alarm/Fault Release'
        this.main.goodProductConditions='Good Product Conditions'
        this.main.standardWorkManagement='Standard Work Management System'
        this.main.operationInstruction='Operation Instruction'
        this.main.partsInstruction='Parts Instruction'
        this.main.lowFrequencyWorkInstruction='Low Frequency Work Instruction'
        this.main.standardWorkGuidance='Standard Work Guidance'
        this.main.processCapabilityManagement='Process Capability Management System'
        this.main.errorProofingManagement='Error Proofing'
        this.main.fixtureManagement='Fixture'
        this.main.purchasedParts='Purchased Parts Management System'
        this.main.incomingInspection='Incoming Inspection'
        this.main.materialCallOut='Material Call-Out'
        this.main.processManagement='Reliable and Efficient Process Management System'
        this.main.controlPlan='Control Plan'
        this.main.controlPlanNew='Control Plan(new)'
        this.main.operationErrorProofing='Operation Error Proofing Analysis'
        this.main.cleanliness='Cleanliness'
        this.main.detectionCapability='Reliable and Accurate Detection Capability Management System'
        this.main.assemblyInspection='Assembly Inspection'
        this.main.assemblyTighteningShaft='Assembly Tightening Shaft'
        this.main.machiningInspection='Machining Inspection'
        this.main.qualityGate='Quality Gate'
        this.main.processDesign='Rigorous Product and Process Design'
        this.main.equipmentMaintenance='Equipment Maintenance'
        this.main.equipmentManagement='Equipment Management'
        this.main.basicInformation='Basic Information Maintenance'
        this.main.jobResponsibility='Job Responsibility'
        this.main.basicInformationMaintenance='Basic Information'
        this.main.maturityImprovement='Maturity Improvement'
        this.main.engineDataQuery='Engine Data Query'
      }
      else if (language==='russian'){
        this.main.logOut='выйти'
        this.main.qualityManagement='Платформа управления качеством'
        this.main.systemManagementSystem='Система управления системой'
        this.main.systemManagement='Управление системой'
        this.main.questionManagement='Управление вопросами'
        this.main.suspiciousProduct='Подозрительный продукт'
        this.main.alarmRelease='Сигнализация/ Выпуск неисправности'
        this.main.goodProductConditions='Хорошие условия продукции'
        this.main.standardWorkManagement='Стандартная система управления работой'
        this.main.operationInstruction='Инструкция по эксплуатации'
        this.main.partsInstruction='Инструкция по деталям'
        this.main.lowFrequencyWorkInstruction='Инструкция по работе с низкой частотой'
        this.main.standardWorkGuidance='Стандартная операционная наведения'
        this.main.processCapabilityManagement='Система управления потенциалом процессов'
        this.main.errorProofingManagement='Проверка ошибок'
        this.main.fixtureManagement='Устройство'
        this.main.purchasedParts='Система управления закупленными деталями'
        this.main.incomingInspection='Входящая инспекция'
        this.main.materialCallOut='Материальный вызов'
        this.main.processManagement='Надежная и эффективная система управления процессами'
        this.main.controlPlan='План контроля'
        this.main.controlPlanNew='План управления(новый)'
        this.main.operationErrorProofing='Анализ проверки ошибок операции'
        this.main.cleanliness='Чистота'
        this.main.detectionCapability='Надежная и точная система управления возможностями обнаружения'
        this.main.assemblyInspection='Инспекция сборки'
        this.main.assemblyTighteningShaft='Сборка затяжающего вала'
        this.main.machiningInspection='Инспекция обработки'
        this.main.qualityGate='Контроль качества'
        this.main.processDesign='Строгое проектирование продукта и процесса'
        this.main.equipmentMaintenance='Техническое обслуживание оборудования'
        this.main.equipmentManagement='Управление оборудованием'
        this.main.basicInformation='Обслуживание базовой информации'
        this.main.jobResponsibility='Рабочая ответственность'
        this.main.basicInformationMaintenance='Основная информация'
        this.main.maturityImprovement='Улучшение зрелости'
        this.main.engineDataQuery='Данные механизма запроса'
      }
      this.$emit('language-changed', language);
    },
    control(doe){
      if (doe===1){
        this.$router.push("/problemManagementNew")
      }
      else if (doe===2){
        this.$router.push("/equipmentMaintain")
      }
      else if (doe===3){
        this.$router.push("/errorProofing")
      }
      else if (doe===4){
        this.$router.push("/operateGuideBook")
      }
      else if (doe===5){
        this.$router.push("/componentGuideBook")
      }
      else if (doe===6){
        this.$router.push("/baseInformation")
      }
      else if (doe===7){
        this.$router.push("/cleanliness")
      }
      else if (doe===8){
        this.$router.push("/systemDocument")
      }
      else if (doe===9){
        this.$router.push("/goodProductConditions")
      }
      //岗位职责管理
      else if (doe===10){
        this.$router.push("/jobDescription")
      }
      //低频作业指导书（新）
      else if (doe===11){
        this.$router.push("/changeModelNew")
      }
      //扭矩管理
      else if (doe===12){
        this.$router.push("/torqueManage")
      }
      //入厂检验板块
      else if (doe===13){
        this.$router.push("/stockTest")
      }
      //工装管理
      else if (doe===14){
        this.$router.push("/equipmentManagement")
      }
      //工装管理
      else if (doe===15){
        this.$router.push("/assemblyEquipment")
      }
      //可疑品业务
      else if (doe===16){
        this.$router.push("/suspectProduct")
      }
      //标准作业引导系统
      else if (doe===17){
        this.$router.push("/workGuide")
      }
      //体系管理系统
      else if (doe===18){
        this.$router.push("/toExamineProblem")
      }
      //机加检验
      else if (doe===19){
        this.$router.push("/macTestCon")
      }
      //成熟度提升
      else if (doe===20){
        this.$router.push("/maturityManage")
      }
      //体系业务化-报警解除
      else if (doe===21){
        this.$router.push("/workExceptionRemoval")
      }
      //叫料系统
      else if (doe===22){
        this.$router.push("/dateBack")
      }
      //控制计划（新）
      else if (doe===23){
        this.$router.push("/controlPlanNew")
      }
      //可疑品新
      else if (doe===24){
        this.$router.push("suspectProductGuo")
      }
      //成品AI品质门
      else if (doe===25){
        this.$router.push("/productDataCheckList")
      }
      //装配检验
      else if (doe===26){
        this.$router.push("/controlTesting")
      }
      //发动机数据查询系统
      else if (doe===27){
        this.$router.push("/engineDataQuery")
      }
    },

    //查询某用户的所有版块权限
    async queryUserList(){
      //输入用户编号，向后端查询信息
      const useId=localStorage.getItem('userName').replace(/"/g, '');
      console.log(useId)
      return this.$request.post('/queryUserListOneRow',{
        fieldName:'userName',
        fieldValue:useId,
      }).then(result=>{
        if (result.code === 401) {
          this.$router.push('UserLogin')
          alert("您未登录，请登录")
        }else {
          if (result.data.length===0){
            if (this.languageS==="chinese"){
              this.$message.error("用户权限未找到，请联系管理员")
            }
            else if (this.languageS==="english"){
              this.$message.error("User permissions not found, please contact the administrator")
            }
            else if (this.languageS==="russian"){
              this.$message.error("Пользовательские права не найдены, пожалуйста, свяжитесь с администратором")
            }
            this.cardDisabled= {
              id: null, // 主键 - int auto_increment
              problemManagement: null, // 质量问题管理页权限 - int
              pokayoke: null, // 防错管理 - int
              userName: '', // 用户名(集团工号) - varchar(10)
              name: '', // 用户姓名 - varchar(30)
              equipmentMaintain: null, // 设备管理权限 - int
              base: null, // 基本表单编辑范围 - int
              componentGuideBook: null, // 零部件作业指导书权限 - int
              controlTesting: null, // 频次检测页权限 - int
              changeModel: null, // 低频作业指导书权限 - int
              operateGuideBook: null, // 工序作业指导书权限 - int
              controlPlan: null, // 控制计划权限 - int
              systemDocument: null, // 体系文件页面权限 - int
              equipmentManagement: null, // 工装管理页权限 - int
              macTestCon: null, // 过程能力监视系统权限 - int
              goodProductCondition: null, // 良品条件人员权限 - int
              suspectProduct: null, // 可疑品业务权限 - int
              controlPlanNew: null, // 控制计划(新) - int
              toExamineProblem: null // 体系管理系统人员权限 - int
            }
            return
          }
          else if (result.data.length>1){
            if (this.languageS==="chinese"){
              this.$message.error("用户名重复，请联系管理员")
            }
            else if (this.languageS==="english"){
              this.$message.error("Duplicate username, please contact the administrator")
            }
            else if (this.languageS==="russian"){
              this.$message.error("Дублирование имени пользователя, пожалуйста, свяжитесь с администратором")
            }
            this.cardDisabled= {
              id: null, // 主键 - int auto_increment
              problemManagement: null, // 质量问题管理页权限 - int
              pokayoke: null, // 防错管理 - int
              userName: '', // 用户名(集团工号) - varchar(10)
              name: '', // 用户姓名 - varchar(30)
              equipmentMaintain: null, // 设备管理权限 - int
              base: null, // 基本表单编辑范围 - int
              componentGuideBook: null, // 零部件作业指导书权限 - int
              controlTesting: null, // 频次检测页权限 - int
              changeModel: null, // 低频作业指导书权限 - int
              operateGuideBook: null, // 工序作业指导书权限 - int
              controlPlan: null, // 控制计划权限 - int
              systemDocument: null, // 体系文件页面权限 - int
              equipmentManagement: null, // 工装管理页权限 - int
              macTestCon: null, // 过程能力监视系统权限 - int
              goodProductCondition: null, // 良品条件人员权限 - int
              suspectProduct: null, // 可疑品业务权限 - int
              controlPlanNew: null, // 控制计划(新) - int
              toExamineProblem: null // 体系管理系统人员权限 - int
            }
            return
          }
          else {
            return result.data[0]
          }
        }
      })
    },
  },
  mounted(){
    if (localStorage.getItem('u_token')==='' || localStorage.getItem('u_token')===undefined || localStorage.getItem('u_token')===null){
      this.$router.push('UserLogin')
      alert("您未登录，请登录/ Please log in/ Пожалуйста, войдите")
    }
  },
  created() {
    this.inquiry()
    if (localStorage.getItem('u_token')==='' || localStorage.getItem('u_token')===undefined || localStorage.getItem('u_token')===null){
      this.$router.push('UserLogin')
      alert("您未登录，请登录/ Please log in/ Пожалуйста, войдите")
    }
    this.queryUserList().then(data=>{
      this.cardDisabled=data
    })
  },
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style>
.headMain{
  color: #ffffff; /* 设置字体颜色为红色 */
  font-size: 18px;
}
.mainDiv{
  border-width: 1px;
  border-style: solid;
  border-color: #c2c2c2;
  width: 90%;
  margin-left: 5%;
}
.el-header{
  color: #ffffff;
  font-size: 35px;
  text-align: center;
  height: 10vh;
  line-height:8vh;
  background-image: url('@/assets/hande.png');
  background-size: 100%;
  /*文字居中*/
  display: flex;
  justify-content: center;/*水平居中*/
  align-items: center;/*垂直居中*/
}
.card-container {
  //display: flex;
  width: 100%; /* 容器宽度 */
  white-space: nowrap; /* 防止内容换行 */
  overflow-x: auto; /* 启用水平滚动条（如果内容超出容器宽度） */
  justify-content: flex-start; /* 水平方向上靠左排列 */
}
.cadMain{
  display:inline-block; /* 使其在同一行显示 */
  margin-top: 5px;
  margin-left: 25px;
  margin-bottom: 15px;
  height: 200px;
  width: 150px;
  background-image: url('@/assets/repairMain.png');
  background-size: 100%;
  position: relative;
  white-space: normal;
}
.mainTitle{
  font-size: 20px;
  color: red;
  font-weight: bold;
}
.textBottom{
  position: absolute;
  bottom: 10px; /* 距离底部的距离 */
  right: 10px; /* 距离右边的距离 */
  font-weight: bold;
  cursor: pointer;
}

.camera-view {
  text-align: center;
  margin-top: 50px;
}
button {
  margin: 10px;
}
.el-link.is-disabled {
  color: #c0c4cc !important; /* 灰色（Element UI 默认禁用颜色） */
  cursor: not-allowed;
}


</style>
